import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {
    public static void main(String[] args) {
        ExecutorService service = Executors.newSingleThreadExecutor();
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务1");
            }
        });


        ExecutorService service2 = Executors.newScheduledThreadPool(10);
        service2.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务2");
            }
        });

        ExecutorService service3 = Executors.newCachedThreadPool();
        service3.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务3");
            }
        });


        ExecutorService service4 = Executors.newFixedThreadPool(10);
        service4.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务4");
            }
        });

    }
}
